const { invalidGoodsID } = require('../constant/error_type')

//校验数据
const validator = async (ctx, next) => {
    try {
        ctx.verifyParams({
            goods_id: 'number'
        })
        await next();
    } catch (error) {
        console.error(error);
        invalidGoodsID.result = error
        return ctx.app.emit('error', invalidGoodsID, ctx)
    }
}

module.exports = {
    validator
}